#include<stdio.h>
#include<string.h>
int main()
{
	int a,b,c,d;
	scanf("%d %d",&a,&b);
	d=a*b;
	if(a<b)
	{
		int c=a;
		a=b;
		b=c;
	}
	c=a%b;
	while(c)
	{
		a=b;
		b=c;
		c=a%b;
	}
	printf("%d %d",b,d/b);
	
	return 0;
}
